package com.magic.java8.date;

import org.junit.Test;

import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZoneOffset;

/**
 * @author mzk
 * @Description
 * @create 2021-04-03 16:57
 */
public class Test1 {
    @Test
    public void test1(){
        Instant now = Instant.now();
        System.out.println("now = " + now);
        System.out.println("Instant.now().atZone(ZoneId.systemDefault()) = " + Instant.now().atZone(ZoneId.systemDefault()));
        System.out.println("Instant.now().atZone(ZoneId.systemDefault()).toEpochSecond() = " + Instant.now().atZone(ZoneId.systemDefault()).toEpochSecond());
        LocalDate now1 = LocalDate.now();
        LocalDate localDate = now1.plusDays(1);
        System.out.println("localDate = " + localDate);
        long l = localDate.atStartOfDay(ZoneOffset.ofHours(8)).toInstant().toEpochMilli()/1000;
        System.out.println("l = " + l);
    }
}
